package com.qf.springbootproject.index.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qf.springbootproject.index.entity.IndexImg;
import com.qf.springbootproject.index.mapper.IndexImgMapper;
import com.qf.springbootproject.index.service.IndexImgService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 轮播图  服务实现类
 *
 * @author
 * @since 2023-02-13
 */
@Service
public class IndexImgServiceImpl extends ServiceImpl<IndexImgMapper, IndexImg> implements IndexImgService {

    /**
     * 轮播图  服务实现类
     */
    @Transactional(propagation = Propagation.SUPPORTS)
    @Override
    public List<IndexImg> indexImg() {
        QueryWrapper<IndexImg> indexImgQueryWrapper = new QueryWrapper<>();
        indexImgQueryWrapper.eq("status", 1)
                .orderByAsc("seq");
        List<IndexImg> indexImgList = list(indexImgQueryWrapper);
        return indexImgList;
    }
}
